package com.itheima.stock.config;

import com.itheima.stock.properties.IdWorkerProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author kaoM1Jy
 * @date 2025/11/11 9:26
 * @description:
 */
@Configuration
public class IdWorkersConfiguration {
  @Bean
  public IdWorkers idWorkers(IdWorkerProperties properties){
    return new IdWorkers(properties.getMachineId(), properties.getDatacenterId());
  }

}
